Fix nomigrate option implementation so that Xen builds.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 20 Oct 2009 09:23:28 +0000 (10:23 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 20 Oct 2009 09:23:28 +0000 (10:23 +0100)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/python/xen/xend/XendDomainInfo.py
xen/arch/x86/domain.c
xen/arch/x86/domctl.c
xen/common/domain.c
xen/common/domctl.c
xen/include/asm-x86/domain.h
xen/include/xen/sched.h

index 1675cbd7602649046c299b57b4e18aeea10cec88..70bd704a77004de9b71ea82b4d335199238dee72 100644 (file)
@@ -2466,7 +2466,7 @@ class XendDomainInfo:
 
         # If nomigrate is set, disable migration
         nomigrate = self.info["platform"].get("nomigrate")
-        if arch.type == "x86" and nomigrate is not None and long(nomigrate) != 0:
+        if nomigrate is not None and long(nomigrate) != 0:
             xc.domain_disable_migrate(self.domid)
 
         # Optionally enable virtual HPET
index 8b414a4ac7c02f309a13a00c4d3fccef0be40b78..82ce9754579ce8e9b7e690209083e5c054a5d392 100644 (file)
@@ -522,9 +522,6 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
 
     spin_lock_init(&d->arch.vtsc_lock);
 
-    if ( d->domain_id == 0 )
-        d->disable_migrate = 1;
-
     return 0;
 
  fail:
index 011e2d71125c7b51f730d662af4c767389694016..581fcb3295c10cab70a4776ecf18d92525b0f8d5 100644 (file)
@@ -1100,24 +1100,6 @@ long arch_do_domctl(
     }
     break;
 
-    case XEN_DOMCTL_disable_migrate:
-    {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
-        domain_pause(d);
-        d->arch.disable_migrate = domctl->u.disable_migrate.disable;
-        domain_unpause(d);
-
-        rcu_unlock_domain(d);
-        ret = 0;
-    }
-    break;
-
     case XEN_DOMCTL_suppress_spurious_page_faults:
     {
         struct domain *d;
index 465aa00a44529e10bc72d5c54570e183c793c9a9..ab3c5bb745304108a1ff657c0af063085671591e 100644 (file)
@@ -239,8 +239,11 @@ struct domain *domain_create(
     if ( domcr_flags & DOMCRF_hvm )
         d->is_hvm = 1;
 
-    if ( (domid == 0) && opt_dom0_vcpus_pin )
-        d->is_pinned = 1;
+    if ( domid == 0 )
+    {
+        d->is_pinned = opt_dom0_vcpus_pin;
+        d->disable_migrate = 1;
+    }
 
     if ( domcr_flags & DOMCRF_dummy )
         return d;
index 44a18ab1ec602db1c3f064c6a668ef17303617d2..0b9ad758ddda0a114431a40d1a9403ee5f845d3d 100644 (file)
@@ -948,6 +948,19 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
     }
     break;
 
+    case XEN_DOMCTL_disable_migrate:
+    {
+        struct domain *d;
+        ret = -ESRCH;
+        if ( (d = rcu_lock_domain_by_id(op->domain)) != NULL )
+        {
+            d->disable_migrate = op->u.disable_migrate.disable;
+            rcu_unlock_domain(d);
+            ret = 0;
+        }
+    }
+    break;
+
     default:
         ret = arch_do_domctl(op, u_domctl);
         break;
index 851a71208d5caa8faeeef75b7e95debc9d9f1e69..08f2696ba96a0a542dde112cc7604e774f27df5a 100644 (file)
@@ -304,9 +304,6 @@ struct arch_domain
     spinlock_t vtsc_lock;
     uint64_t vtsc_kerncount; /* for hvm, counts all vtsc */
     uint64_t vtsc_usercount; /* not used for hvm */
-
-    /* mark domain as non-migratable and non-restoreable */
-    bool_t disable_migrate;
 } __cacheline_aligned;
 
 #define has_arch_pdevs(d)    (!list_empty(&(d)->arch.pdev_list))
index a8fe8de126f767da8988685af6d9ce5bd399610b..03907f7b4ca2cc5946744b285f0d6a9cb0622883 100644 (file)
@@ -278,6 +278,9 @@ struct domain
     void *tmem;
 
     struct lock_profile_qhead profile_head;
+
+    /* Non-migratable and non-restoreable? */
+    bool_t disable_migrate;
 };
 
 struct domain_setup_info